Skip to content

BTC v36: chain-agnostic core::donation SSOT (delegate BTC) - #139

Merged
frstrtr merged 1 commit into
masterfrom
btc/v36-core-donation
Jun 17, 2026
Merged

BTC v36: chain-agnostic core::donation SSOT (delegate BTC)#139
frstrtr merged 1 commit into
masterfrom
btc/v36-core-donation

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 17, 2026

Copy link
Copy Markdown
Owner

What

Introduces src/core/donation.hpp as the chain-agnostic single source of truth for the c2pool donation script, and delegates btc::PoolConfig::get_donation_script() to it. Removes the per-coin DONATION_SCRIPT / COMBINED_DONATION_SCRIPT arrays from the BTC PoolConfig.

Why

The donation script bytes are coin-invariant — no network version byte, and the v36 P2SH redeem hash160 (8c627262..8e85) is uniform across btc/ltc/bch/dgb. Only the base58 rendering differs per coin prefix, never the committed script. They were nonetheless duplicated in each per-coin PoolConfig. Per the operator FLAG6 re-scope (2026-06-17), the v36 donation must be bitcoin-agnostic; the defect was ownership living in a per-coin namespace, not the content.

Scope / safety

  • Pure refactor: byte-identical scripts (P2PK pre-v36 forrestv; combined P2SH 1-of-2 v36+, FLAG6 option-b).
  • All call sites unchanged — every consumer already routes through get_donation_script(); the only external references to the array names are comments.
  • c2pool-btc builds green.

Follow-up (cross-coin, separate PR)

Migrate ltc/doge/bch/dgb PoolConfigs to delegate to core::donation and delete their duplicate arrays. BTC-first here to keep the diff reviewable; cross-coin touches LTC namespace (ltc-doge lane).

The donation script bytes are coin-invariant (no network version byte;
uniform v36 redeem hash160) yet were duplicated in every per-coin
PoolConfig. Per operator FLAG6 re-scope (2026-06-17), the v36 donation
must be bitcoin-agnostic. Introduce src/core/donation.hpp as the single
source of truth and delegate btc::PoolConfig::get_donation_script() to it,
removing the per-coin DONATION_SCRIPT / COMBINED_DONATION_SCRIPT arrays.

Pure refactor: identical bytes, all call sites unchanged (they route via
get_donation_script). c2pool-btc builds green. Cross-coin follow-up will
migrate ltc/doge/bch/dgb to the same delegate.
@frstrtr
frstrtr merged commit b657e2b into master Jun 17, 2026
16 checks passed
@frstrtr
frstrtr deleted the btc/v36-core-donation branch June 17, 2026 20:16
frstrtr added a commit that referenced this pull request Jun 23, 2026
Mirror of LTC v36 commit 18dd945 onto the BTC variant. All three gentx
sites (generate_share_transaction / create_local_share_v35 /
create_local_share) now exclude BOTH donation scripts (COMBINED + P2PK)
from per-miner payout dests and fold the COMBINED_DONATION_SCRIPT-keyed
weight into the single donation-last output. Rides core/donation.hpp SSOT
(FLAG6 #139). No F1 entanglement (F11 touches only the payout-sort path).

Prep-branch staging; PR stays unopened until integrator dispatches the
F-mirror post crossing-soak (#97). +51/-6, matches LTC F11 line counts.
frstrtr added a commit that referenced this pull request Jun 23, 2026
Mirror of LTC v36 commit 18dd945 onto the BTC variant. All three gentx
sites (generate_share_transaction / create_local_share_v35 /
create_local_share) now exclude BOTH donation scripts (COMBINED + P2PK)
from per-miner payout dests and fold the COMBINED_DONATION_SCRIPT-keyed
weight into the single donation-last output. Rides core/donation.hpp SSOT
(FLAG6 #139). No F1 entanglement (F11 touches only the payout-sort path).

Prep-branch staging; PR stays unopened until integrator dispatches the
F-mirror post crossing-soak (#97). +51/-6, matches LTC F11 line counts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant